package com.wxzz.elearing.comment.api.admin;


import com.alibaba.fastjson.JSONObject;
import com.wxzz.elearing.comment.dto.AdminQueAnsEnterpriseDto;
import com.wxzz.elearing.comment.dto.OrderIdDto;
import com.wxzz.elearing.comment.service.IEnterpriseQuesAnsService;
import com.wxzz.elearing.comment.vo.EnterpriseQueAnsVo;
import com.wxzz.elearing.comment.vo.QueAnsUserInfoVo;
import com.wxzz.elearing.comment.vo.QuestionsAnswersListVo;
import com.wxzz.elearning.common.vo.JgPageVo;
import com.wxzz.elearning.common.vo.ReturnVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 
 * @since 2021-05-18
 */
@RestController
@RequestMapping("/admin-enterprise-ques-ans")
@Api(tags = "企业问答类接口(总后台)")
public class AdminEnterpriseQuesAnsController {

    @Autowired
    private IEnterpriseQuesAnsService enterpriseQuesAnsService;

    @ApiOperation(value = "企业问答列表(总后台)", notes = "企业问答列表(总后台)", httpMethod = "POST", tags = "后台")
    @RequestMapping(value = "queryQuestionsAnswersList", method = RequestMethod.POST)
    public ReturnVO<JgPageVo<List<EnterpriseQueAnsVo>>> queryQuestionsAnswersList(@RequestBody AdminQueAnsEnterpriseDto adminQueAnsEnterpriseDto, @RequestHeader(value = "token") String token) {
        return enterpriseQuesAnsService.getEnterpriseQueAnsList(adminQueAnsEnterpriseDto);
    }

    @ApiOperation(value = "用户信息(总后台)", notes = "用户信息(总后台)", httpMethod = "POST", tags = "后台")
    @RequestMapping(value = "userInfo/{userId}", method = RequestMethod.POST)
    public ReturnVO<QueAnsUserInfoVo> userInfo(@PathVariable("userId") Long userId) {
        return enterpriseQuesAnsService.getUserInfo(userId);
    }
}
